<template>
  <div class="container">
    <div class="main">
      <div class="title">{{detail.realname}}</div>
      <img class="img" :src="detail.image|imgPath" alt>
      <div class="content">{{detail.content}}</div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      detail: {}
    }
  },
  created () {
    const id = this.$route.params.id
    if (id) {
      this.getDetail(id)
    }
  },
  methods: {
    getDetail (id) {
      this.$axios
        .get(`/xbkj-dj/web/showuser/getShowuser?id=${id}`)
        .then(res => {
          this.detail = res.data
        })
    }
  }
}
</script>
<style lang="less" scoped>
.container {
  padding: 20px;
}
.main {
  border-radius: 6px;
  background-color: #fff;
  padding: 10px;
  .title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    padding: 10px 0;
  }
  .img {
    display: block;
    width: 30%;
    margin: 0 auto;
  }
  .content {
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.8;
    padding: 10px;
  }
}
</style>
